package com.runssnail.juhe.api.request.mobile;

import com.runssnail.juhe.api.request.GetRequest;
import com.runssnail.juhe.api.response.mobile.GetMobileOrderStatusResponse;

import java.util.HashMap;
import java.util.Map;

/**
 * 话费充值订单状态查询接口
 * <p>
 * Created by zhengwei on 16/4/15.
 */
public class GetMobileOrderStatusRequest extends GetRequest<GetMobileOrderStatusResponse> {

    /**
     * 商家订单号，8-32位字母数字组合，请填写已经成功提交的订单号
     */
    private String orderId;

    /**
     * @param orderId 商家订单号，8-32位字母数字组合，请填写已经成功提交的订单号
     */
    public GetMobileOrderStatusRequest(String orderId) {
        this.orderId = orderId;
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    @Override
    public String getApiUrl() {
        return "http://op.juhe.cn/ofpay/mobile/ordersta";
    }

    @Override
    public Map<String, Object> getParams() {

//        orderid	string	是	商家订单号，8-32位字母数字组合，请填写已经成功提交的订单号
//        key	string	是	应用APPKEY(应用详细页查询)

        Map<String, Object> params = new HashMap<>();
        params.put("orderid", this.orderId);

        return params;
    }

    @Override
    public Class<GetMobileOrderStatusResponse> getResponseClass() {
        return GetMobileOrderStatusResponse.class;
    }
}
